# 定义变量  
CC = gcc                       # 使用的编译器  
CFLAGS = -Wall -g             # 编译选项  
SOURCE_FILES = exec1.c exec2.c exec3.c forkdemo1.c forkdemo2.c forkdemo3.c forkdemo4.c \
               forkgdb.c psh1.c psh2.c testbuf1.c testbuf2.c testbuf3.c testpid.c \
               testpp.c testsystem.c waitdemo1.c waitdemo2.c waitdemo3.c  psh3.c
EXECUTABLES = $(SOURCE_FILES:.c=)  

# 默认目标  
all: $(EXECUTABLES)  

# 规则：每个可执行文件对应的目标  
%: %.c  
	$(CC) $(CFLAGS) -o $@ $<  

# 清理目标  
clean:  
	rm -f $(EXECUTABLES)
